import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: ()=>import ('./../pages/home'),
      redirect:'/home',
      name: 'Home'
    },
    {
      path: '/home',
      component: ()=>import ('./../pages/home'),
      name: 'Home'
    },
    {
      path:'/goal',
      component: ()=>import ('./../pages/goal'),
      name: 'Goal',
    },
    {
      path:'/limitTime',
      component: ()=>import ('./../pages/limitTime'),
      name: 'LimitTime',
    },
    {
      path:'/flag',
      component: ()=>import ('./../pages/flag'),
      name: 'Flag',
    },
    {
      path:'/poster',
      component: ()=>import ('./../pages/poster'),
      name: 'Poster',
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
     return savedPosition
    } else {
     return { x: 0, y: 0 }
    }
    }
})
